package mobile.android.portal.ui;

import mobile.android.portal.R;
import mobile.android.portal.R.layout;
import mobile.android.portal.util.Session;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MobileBusinessPortalActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_mobile_portal);
		if (Session.getUser() != null) {
			Log.v("Session user", Session.getUser().getProducer_name());
		}
	}

	public void onSearchProductButtonClick(View v) {
		Intent browseProductSceen = new Intent(this,
				BrowseProductActivity.class);
		startActivity(browseProductSceen);
	}

	public void onCreateAccountButtonClick(View v) {
		Intent createAccountScreen = new Intent(this,
				CreateAccountActivity.class);
		startActivity(createAccountScreen);
	}

	public void onLogInButtonClick(View v) {
		Intent logInScreen = new Intent(this, LoginActivity.class);
		startActivity(logInScreen);
	}

	public void onAddProductButtonClick(View v) {
		Intent addProductInfoScreen = new Intent(this,
				AddProductInformationActivity.class);
		startActivity(addProductInfoScreen);
	}

	public void onBackPressed() {
		super.onBackPressed();
		int pid = android.os.Process.myPid();
		android.os.Process.killProcess(pid);
	}
}